<?php

namespace App\Http\Controllers\Api;


use App\Models\GoodsType;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;


class GoodsTypeController extends Controller
{
    protected $model;

    public function __construct(GoodsType $goodsType)
    {
        $this->model = $goodsType;
    }

    public function goodsType(Request $request)
    {
        $cates = GoodsType::getcates();
        $category = [];
        if (!empty($cates)) {
            foreach ($cates as $key => $val) {
                $category[] = array(
                    'categoryId' => $key,
                    'categoryName' => $val
                );
            }
        }
        return $this->success($category);
    }
}


